package cn.gson.springboot.model.service;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.alibaba.fastjson.JSONArray;

import cn.gson.springboot.model.mapper.ArrangeclassMapper;
import cn.gson.springboot.model.mapper.CureCostMapper;

@Service
@Transactional(rollbackFor=Exception.class)
public class Arrangeclassserivce {//该serivce注解在GHlxcontroller
		@Autowired
		private ArrangeclassMapper  Amp;
		
		//医疗项目费用service
		@Autowired
		private CureCostMapper  cm;
		
		//查询上班医生
		public JSONArray cxsbys(Integer departments_id, Integer arrange_classes_id) {
			return Amp.cxsbys(departments_id, arrange_classes_id);
		}
		//查询上班护士
				public JSONArray cxsbhs(Integer departments_id, Integer arrange_classes_id) {
					return Amp.cxsbhs(departments_id, arrange_classes_id);
				}
		
		
		//<!--  查询排班晚班专用-->
		public JSONArray wbcxsbys(Integer departments_id, Integer arrange_classes_id) {
			return Amp.wbcxsbys(departments_id, arrange_classes_id);
		}
		
		//查询所有挂号记录
		public  JSONArray ghjl() {
			JSONArray ghjl = Amp.ghjl();
			return ghjl;
		}
		
		/*<!-- 根据医生id查询挂该医生的病人 -->*/
		public JSONArray ysidcbr(String mecard_number) {
			if(mecard_number!=null) {
				if(mecard_number.trim().equals("")) {
					mecard_number=null;
				}
			}
			return Amp.ysidcbr(mecard_number);
		}
		
		
		/*<!-- 根据医生id查询挂该医生的病人 -->*/
		public JSONArray ysidcbrer(Integer user_id,String mecard_number) {
			if(mecard_number!=null) {
				if(mecard_number.trim().equals("")) {
					mecard_number=null;
				}
			}
			return Amp.ysidcbrer(user_id, mecard_number);
		}
		
		
		//查询所有未交费的医疗项目
		public  JSONArray findCrueCost() {
			  JSONArray findcruecost = cm.findcruecost();
			  return findcruecost;
		}
		
		//查询所有以交费的医疗项目
		public  JSONArray findCrueCosty() {
					  JSONArray findcruecosty = cm.findcruecosty();
					  return findcruecosty;
		}
		
		//根据医疗卡号查询未交费的医疗项目
		public  JSONArray medfindCrueCost(String mecard_number) {
				JSONArray medfindcruecost = cm.medfindcruecost(mecard_number);
				return medfindcruecost;
		}
		//根据医疗卡号查询以交费的医疗项目
		public  JSONArray medfindCrueCosty(String mecard_number) {
				JSONArray medfindcruecosty = cm.medfindcruecosty(mecard_number);
				return medfindcruecosty;
		}
		
		
		/* 通过医疗项目主表id查询详表 */
		public  JSONArray  idMzcostDetails(Integer cure_cost_id) {
			JSONArray idMzcostDetails = cm.idMzcostDetails(cure_cost_id);
			return idMzcostDetails;
		}
		
		//根据医疗卡卡号查询挂号记录 -->
		public  JSONArray medidgh(String mecard_number) {
			if(mecard_number!=null) {
				if(mecard_number.trim().equals("")) {
					mecard_number=null;
				}
			}
			JSONArray medidgh = Amp.medidgh(mecard_number);
			return medidgh;
		}
		//<!-- 根据医生id和医疗卡号查询挂该医生的病人-->
		public  JSONArray ysidheykkh(Integer user_id,String mecard_number){
				JSONArray ysidheykkh = Amp.ysidheykkh(user_id, mecard_number);
				return ysidheykkh;
		}

}
